﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TravelLib
{
    public static partial class Utils
    {
        private static int[,] _destinationGraph = null;
        public static int[,] DestinationGraph
        {
            get
            {
                if (null == _destinationGraph)
                    InitDestinationsGraph();
                return _destinationGraph;
            }
            set { _destinationGraph = value; }
        }

        public static void InitDestinationsGraph()
        {
            _destinationGraph = new int[5, 5] { { 0, 0, 1, 0, 0 }, { 0, 0, 1, 1, 0 }, { 1, 1, 0, 1, 1 }, { 0, 1, 1, 0, 0 }, { 0, 0, 1, 0, 0 } };
            AirportManager.Airports = new List<Airport>();
            char ch='A';
            for (int i = 0; i < DestinationGraph.GetLength(0); ++i)
            {
                
                AirportManager.Airports.Add(new Airport(i, ch.ToString(), GetAirportDescription(ch.ToString())));
                ch++;
            }
        }

        private static string GetAirportDescription(string ch)
        {
            switch (ch)
            {
                case "A": return "Paris";
                case "B": return "London";
                case "C": return "Berlin";
                case "D": return "Zurich";
                case "E": return "Bucharest";
                default: return ch + " Airport ";
            }
        }

    }
}
